<include file="Public/header" />
<style>
  .fileUpload {
  position: relative;
  overflow: hidden;
  margin: 10px;
}

.fileUpload input.upload {  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
  padding: 0;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  filter: alpha(opacity=0);
}
</style>
    <!-- 主体 -->
    <div class="row" style="width:80%; margin:5px auto;">
      <!-- 左侧菜单 -->
      <div class="col-sm-3">
        <div class="sidebar-module">
          <ul class="nav nav-list">
            <li class="nav-header">功能列表</li>
            <li ><a href="{:U('/Admin/Arts/artadd')}">写文章</a></li>
            <li><a href="{:U('/Admin/Cat/cat')}">管理分类</a></li>
            <li><a href="#">帮助</a></li>
            <li><a href="#">帮助</a></li>
            <li class="nav-header">列表标题</li>
            <li class="active"><a href="#">首页</a></li>
            <li><a href="#">库</a></li>
            <li><a href="#">应用</a></li>
          </ul>
        </div>
      </div>
      <!-- 右侧主体 -->
      <div class="col-sm-8 col-sm-offset-1">
        <h3>栏目列表</h3>
        <table class="table">
          <thead>
            <tr>
              <th>
                栏目ID
              </th>
              <th>
                栏目名称
              </th>
              <th>
                上级栏目
              </th>
              <th>
                操作
              </th>
            </tr>
          </thead>
          <tbody>
            <foreach name="cats" item="c">
              <tr style="border-bottom:1px solid #999;">
              <td>
                {$c[cat_id]}
              </td>
              <td>
                <a href="{:U('/Home/Article/artshow',array('aid'=>$a['aid']))}">{$c[cat_name]}</a>
              </td>
              <td>
            <foreach name="cats" item="cat">
              <if condition="($c['parent_id'] eq $cat['cat_id'])">
                {$cat[cat_name]}
              </if>
            </foreach>
              </td>
              <td>
                编辑<a href="{:U('/')}"></a> | <a href="{:U('/Admin/Cat/catDelete',array('cat_id'=>$c['cat_id']))}"></a>删除
              </td>
              </tr>
            </foreach>
          </tbody>
        </table>
<!--         <nav>
          <ul class="pagination">
            <li class="disabled"><a href="#">上一页</a></li>
            <li class="active"><a href="#">1</a></li>
            <li><a href="#">2</a></li>
            <li><a href="#">3</a></li>
            <li><a href="#">4</a></li>
            <li><a href="#">5</a></li>
            <li><a href="#">下一页</a></li>
          </ul>
        </nav> -->
      </div>
      <div class="col-sm-8 col-sm-offset-1">
        <h3>添加栏目</h3>
        <form action="" method="post" class="form-group" enctype="multipart/form-data" >
          <div class="input-group input-group-lg" style="margin-bottom:10px;">
            <input type="text" name="cat_name"class="form-control" placeholder="新增栏目名">
            <span class="input-group-addon">栏目名称</span>
          </div>
          <div class="form-group">上级栏目：
            <select name="parent_id" id="">
                <li role="presentation">
                  <option value="0">请选择</option>
                </li>
              <foreach name="cats" item="c">
                <li role="presentation">
                  <option value="{$c[cat_id]}">{$c[cat_name]}</option>
                </li>
              </foreach>
            </select>
          </div>
            <input class="btn btn-primary" type="submit" value="添加">
        </div>
      </form>
    </div>
<include file="Public/footer" />